import Vue from 'vue'
import Router from 'vue-router'

// 要告诉 vue 使用 vueRouter 
Vue.use(Router);



export default new Router({
  // mode: 'history',
  routes: [
    { path: '', redirect: 'login' },
    {  //登录页面
      path: '/login',
      name: 'login',
      component: resolve => require(['@/views/login/login'], resolve),
      meta: {
        keepAlive: false,    //标识是否需要左侧菜单栏
        // requiresAuth:true   //标识是否需要登录
      }
    },
    {  //在科患者页面
      path: '/inpatients',
      name: 'inpatients',
      component: resolve => require(['@/views/inPatients/inPatients'], resolve),
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //病情统计页面
      path: '/diseasestatistics',
      name: 'diseasestatistics',
      component: resolve => require(['@/views/diseaseStatistics/diseaseStatistics'], resolve),
      meta: {
        keepAlive: true,     //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //在修改密码页面
      path: '/changePassword',
      name: 'changePassword',
      component: resolve => require(['@/views/changePassword/changePassword'], resolve),
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //患者基本信息页面
      path: '/basicInformation',
      name: 'basicInformation',
      component: resolve => require(['@/views/basicInformation/basicInformation'], resolve),
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //在患者医嘱页面
      path: '/medicalAdvice',
      component: resolve => require(['@/views/medicalAdvice/medicalAdvice'], resolve),
      children: [
        {   //患者医嘱列表页
          path: '/',
          component: resolve => require(['@/views/medicalAdvice/medicalAdviceContent/medicalAdviceList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        //{
        //  path: 'medicalAdviceDetails',
        //  name: 'medicalAdviceDetails',    //患者医嘱详情页
        //  component: resolve => require(['@/views/medicalAdvice/medicalAdviceContent/medicalAdviceDetails'], resolve),
        //  meta: {
        //    keepAlive: true,    //标识是否需要左侧菜单栏
        //    requiresAuth: true   //标识是否需要登录
        //  }
        //},
      ],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {     //病厉页面
      path: '/medicalHistory',
      component: resolve => require(['@/views/medicalHistory/medicalHistory'], resolve),
      children: [
        { path: '', redirect: 'medicalHistoryList' },
        { //患者病历列表页
          path: 'medicalHistoryList',
          component: resolve => require(['@/views/medicalHistory/medicalHistoryContent/medicalHistoryList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        { //患者病历详情页
          path: 'medicalHistoryDetails/:caseOfLllnessID',
          name: 'medicalHistoryDetails',
          component: resolve => require(['@/views/medicalHistory/medicalHistoryContent/medicalHistoryDetails'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        }
      ],
      meta: {
        keepAlive: true,     //标识是否需要左侧菜单栏
        requiresAuth: true  //标识是否需要登录
      }
    },
    {  //检验报告检查报告总页面页面
      path: '/reportpage',
      component: resolve => require(['@/views/reportPage/reportPage'], resolve),
      children: [
        { path: '', redirect: 'inspectionReportListPage' },
        {
          path: 'inspectionReportListPage',              /*检查报告列表页面*/
          component: resolve => require(['@/views/reportPage/reportPageContent/inspectionReportListPage'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        {
          path: '/reportpage/testReportListPage',              /*检验报告列表页面*/
          component: resolve => require(['@/views/reportPage/reportPageContent/testReportListPage'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        {
          path: '/reportpage/reportTestresult',/*检验报告详情页面*/
          name:'reportTestresult',
          component: resolve => require(['@/views/reportPage/reportPageContent/reportDetailsPage/reportTestresult'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        {
          path: '/reportpage/reportExaminationResult/:idReport/:ReportPage/:reportName/:reportTime',              /*检查报告详情页面*/
          name: 'reportExaminationResult',
          component: resolve => require(['@/views/reportPage/reportPageContent/reportDetailsPage/reportExaminationResult'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        {
          path: '/reportpage/reportIndexItem',              /*报告搜索指标项详情页面*/
          name: 'reportIndexItem',
          component: resolve => require(['@/views/reportPage/reportPageContent/reportDetailsPage/reportIndexItem'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
        {
          path: '/reportpage/reportIndexComparison',              /*报告指标项对比详情页面*/
          name: 'reportIndexComparison',
          component: resolve => require(['@/views/reportPage/reportPageContent/reportDetailsPage/reportIndexComparison'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          },
        },
      ],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //体征总页面页面
      path: '/physicalSignPage',
      component: resolve => require(['@/views/physicalSignPage/physicalSignPage'], resolve),
      children: [
        { path: '', redirect: 'signsVs' },
        {
          path: 'signsVs',        //体征子页面VS
          component: resolve => require(['@/views/physicalSignPage/physicalSignContent/signsVs'], resolve),
          children: [
            { path: '', redirect: 'signsVsSubSurface' },
            {
              path: 'signsVsSubSurface',        //体征vs子页面的表
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsVsSubSurface'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
            {
              path: 'signsVsSubChart',        //体征vs子页面的折线图
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsVsSubChart'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
          ],
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'signsIo',        //体征子页面Io 
          component: resolve => require(['@/views/physicalSignPage/physicalSignContent/signsIo'], resolve),
          children: [
            { path: '', redirect: 'signsIoSubSurface' },
            {
              path: 'signsIoSubSurface',        //体征子页面Io的子页面时间轴页
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsIoSubSurface'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
            {
              path: 'signsIoSubChart',        //体征子页面Io的子页面趋势图页
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsIoSubChart'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
            ],
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'signsBreathe',        //体征子页面呼吸
          component: resolve => require(['@/views/physicalSignPage/physicalSignContent/signsBreathe'], resolve),
          children: [
            { path: '', redirect: 'signsBreatheSubSurface' },
            {
              path: 'signsBreatheSubSurface',        //体征子页面呼吸的子页面时间轴页
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsBreatheSubSurface'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
            {
              path: 'signsBreatheSubChart',        //体征子页面呼吸的子页面趋势图页
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsBreatheSubChart'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
          ],
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'signsDetails',        //体征各项指标的详情
          component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsDetails'], resolve),
          children: [
            { path: '', redirect: 'singsDetailsSurface' },
            {
              path: 'singsDetailsSurface',        //体征子页面体温和自主呼吸频率、心率或者脉搏等指标详情统计表页面
              name: 'singsDetailsSurface',
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsDetails/singsDetailsSurface'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
            {
              path: 'singsDetailsChart',        //体征子页面体温和自主呼吸频率、心率或者脉搏等指标详情统计图页面
              name: 'singsDetailsChart',
              component: resolve => require(['@/views/physicalSignPage/physicalSignContent/physicalSignSubPage/signsDetails/singsDetailsChart'], resolve),
              meta: {
                keepAlive: true,    //标识是否需要左侧菜单栏
                requiresAuth: true   //标识是否需要登录
              }
            },
          ],
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        
      ],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      },
    },
    {  //手术信息页面
      path: '/operationPage',
      component: resolve => require(['@/views/operationPage/operationPage'], resolve),
      //children: [
       //{ path: '', redirect: 'signsVs' },
      //  {
      //    path: '/',
      //    component: resolve => require(['@/views/operationPage/operationPageContent/operationMessagePage'], resolve),
      //    meta: {
      //      keepAlive: true,    //标识是否需要左侧菜单栏
      //      requiresAuth: true   //标识是否需要登录
      //    },
      //  },

      //],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //评分页面
      path: '/scorePage',
      component: resolve => require(['@/views/scorePage/scorePage'], resolve),
      children: [
        { path: '', redirect: 'scoreListPage' },
        {
          path: 'scoreListPage',
          component: resolve => require(['@/views/scorePage/scoreContent/scoreListPage'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'scoreDetailsPage',
          component: resolve => require(['@/views/scorePage/scoreContent/scoreDetailsPage'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'mewsScoreSurface',
          component: resolve => require(['@/views/scorePage/scoreContent/mewsScoreSurface'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'mewsScoreChart',
          component: resolve => require(['@/views/scorePage/scoreContent/mewsScoreChart'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //患者护理单页面
      path: '/nursingListPage',
      component: resolve => require(['@/views/nursingList/nursingListPage'], resolve),
      children: [
        { path: '', redirect: 'nursingListDetails' },
        {
          path: 'nursingListDetails',        //体征子页面体温和自主呼吸频率、心率或者脉搏等指标详情统计图页面
          component: resolve => require(['@/views/nursingList/nursingListContent/nursingListDetails'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },

      ],
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //患者护理单PDF页面
      path: '/nursingPdf',
      component: resolve => require(['@/views/nursingList/nursingPdf'], resolve),
      meta: {
        requiresAuth: true,   //标识是否需要登录
         keepAlive: false,  
      }
    }, 
    {  //重症质控页
      path: '/qualityControl', 
      component: resolve => require(['@/views/qualityControl/qualityControl'], resolve),
      children: [
        { path: '', redirect: 'qualityControldChart' },
        {
          path: 'qualityControldChart',        //体征子页面体温和自主呼吸频率、心率或者脉搏等指标详情统计图页面
          component: resolve => require(['@/views/qualityControl/qualityControlContent/qualityControldChart'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        }, 
        {
          path: 'qualityControldDetails',        //体征子页面体温和自主呼吸频率、心率或者脉搏等指标详情统计图页面
          component: resolve => require(['@/views/qualityControl/qualityControlContent/qualityControldDetails'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },

      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    {  //交班日志
      path: '/patientShiftLog', 
      component: resolve => require(['@/views/patientShiftLog/patientShiftLog'], resolve),
      children: [
        { path: '', redirect: 'patientShiftLogList' },
        {
          path: 'patientShiftLogList',        //交班日志列表页
          name:'patientShiftLogList',
          component: resolve => require(['@/views/patientShiftLog/patientShiftLogContent/patientShiftLogList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        }, 
        {
          path: 'patientShiftLogEdit',        //交班日志编辑界面
          name:'patientShiftLogEdit',
          component: resolve => require(['@/views/patientShiftLog/patientShiftLogContent/patientShiftLogEdit'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },

      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    {
      path: '/patientShiftLogPrint',        //交班日志打印
      component: resolve => require(['@/views/patientShiftLog/patientShiftLogPrint'], resolve),
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
      //交班信息页(单个患者的)
    {
      path: '/handOver',
      component: resolve => require(['@/views/handOver/handOver'], resolve),
      children: [
        { path: '', redirect: 'handOverList' },
        {
          path: 'handOverList',        //交班信息详情页
          component: resolve => require(['@/views/handOver/handOverContent/handOverList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'handOverDetails',        //交班信息详情页
          component: resolve => require(['@/views/handOver/handOverContent/handOverDetails'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    //新增用户（注册临时用户）
    {
      path: '/registeredUser',
      component: resolve => require(['@/views/registeredUser/registeredUser'], resolve),
      children: [
        { path: '', redirect: 'registeredUserChart' },
        {
          path: 'registeredUserFrom',        //注册信息填写
          component: resolve => require(['@/views/registeredUser/registeredUserContent/registeredUserFrom'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'registeredUserChart',        //临时用户列表展示
          component: resolve => require(['@/views/registeredUser/registeredUserContent/registeredUserChart'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    //交班信息（所有患者）
    {
      path: '/inpatientsAll',
      component: resolve => require(['@/views/inpatientsAll/inpatientsAll'], resolve),
      children: [
        { path: '', redirect: 'inpatientsAllList' },
        {
          path: 'inpatientsAllList',        //交班信息详情页
          component: resolve => require(['@/views/inpatientsAll/inpatientsAllContent/inpatientsAllList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    //所有患者信息
    {
      path: '/handOverAll',
      component: resolve => require(['@/views/handOver/handOverAll'], resolve),
      children: [
        { path: '', redirect: 'handOverAllList' },
        {
          path: 'handOverAllList',        //交班信息详情页
          component: resolve => require(['@/views/handOver/handOverContent/handOverAllList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'handOverDetails',        //交班信息详情页
          component: resolve => require(['@/views/handOver/handOverContent/handOverDetails'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    // 收藏的患者
    {
      path: '/collection',
      component: resolve => require(['@/views/collection/collection'], resolve),
      children: [
        { path: '', redirect: 'collectionList' },
        {
          path: 'collectionList',        //交班信息详情页
          component: resolve => require(['@/views/collection/collectionContent/collectionList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    {
      path: '/handOverPrint',        //交班信息打印
      component: resolve => require(['@/views/handOver/handOverPrint'], resolve),
      meta: {
        keepAlive: true,    //标识是否需要左侧菜单栏
        requiresAuth: true   //标识是否需要登录
      }
    },
    {  //空白页
      path: '/emptyPage',
      component: resolve => require(['@/components/main/emptyPage'], resolve),
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: false,
      }
    },
    {  //事件分析
      path: '/eventsAnalysis',
      component: resolve => require(['@/views/eventsAnalysis/eventsAnalysis'], resolve),
      children: [
        { path: '', redirect: 'eventsReport' },
        {
          path: 'eventsReport',        //分析折现图页
          component: resolve => require(['@/views/eventsAnalysis/eventsAnalysisContent/eventsReport'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
        {
          path: 'eventList',        //分析折现图页
          component: resolve => require(['@/views/eventsAnalysis/eventsAnalysisContent/eventList'], resolve),
          meta: {
            keepAlive: true,    //标识是否需要左侧菜单栏
            requiresAuth: true   //标识是否需要登录
          }
        },
      ],
      meta: {
        requiresAuth: true,   //标识是否需要登录
        keepAlive: true,
      }
    },
    ] 
})
